home *** CD-ROM | disk | FTP | other *** search
- Path: news.kth.se!news
- From: Anders Olsson <aolsson@struct.kth.se>
- Newsgroups: comp.lang.c++
- Subject: OO design issue
- Date: 9 Jan 1996 12:47:49 GMT
- Message-ID: <4cto5l$2gu@news.kth.se>
- NNTP-Posting-Host: lotus.ce.kth.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
-
-
- I have some questions about how to design relations between a class and
- its member classes.
-
- I can simplify my problem to the following two classes:
-
- class Node
- {
- public:
- double GetXCoordinate();
- private:
-
- };
-
- class Triangle
- {
- public:
- double CalculateArea();
- private:
- int nNodeIndex[3]; // Index into node vector
- };
-
- class TrianglesAndNodes
- {
- private:
- vector<Node> NodeVector;
- vector<Element> ElementVector;
- };
-
-
-
-